package com.smart.nacos.consumer.api;

import com.smart.nacos.consumer.reqeuest.UserReqeust;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 *
 */
@FeignClient(value = FeignConstants.PROVIDER_SERVER_NAME, path = "/provider")
public interface ProviderApi {
    @GetMapping("/")
    String hello();

    @GetMapping("/msg")
    String msg(@RequestParam String msg);

    @GetMapping("/user/list")
    String list(@RequestParam UserReqeust userReqeust);

    /**
     * 错误的请求方式
     *
     * @param userReqeust
     * @return
     */
    @GetMapping("/user/obj")
    String obj(@RequestParam UserReqeust userReqeust);

    @PostMapping("/user/json")
    String json(@RequestBody UserReqeust userReqeust);

}
